#pragma once

#include <tuple>
#include <utility>

template <typename Func, typename... Args>
decltype(auto) ForwardAsLambda(Func &&f, Args &&... args) {
  return
      [f   = std::forward<decltype(f)>(f),
       tup = std::make_tuple(std::forward<decltype(args)>(args)...)]() mutable {
        return std::apply(std::move(f), std::move(tup));
      };
}